{% extends "../../../../../view/layouts/admin.html" %} 
{% block content %}
<header class="header navbar bg-white shadow">
	<div class="btn-group tool-button">
		<a class="btn btn-primary navbar-btn" href="/app/ad/admin/position">返回</a>
	</div>
</header>

<div class="content-wrap">
	<div class="wrapper" style="min-height:500px;">
		<section class="panel panel-form pt25">
			<form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="/app/ad/admin/addpos" method="post">
				<div class="row mb10">
					<div class="col-lg-12">
						
						
						<div class="form-group">
							<label for="name" class="col-sm-2 control-label">广告位名称</label>

							<div class="col-sm-8">
								<input type="text" id="name" class="form-control" name="name" data-parsley-required="true" placeholder="广告位名称">
							</div>
						</div>
						<div class="form-group">
							<label for="code" class="col-sm-2 control-label">广告位标识</label>

							<div class="col-sm-8">
								<input type="text" id="code" class="form-control" name="code" data-parsley-required="true" placeholder="广告位标识">
							</div>
						</div>
						<div class="form-group">
							<label for="type" class="col-sm-2 control-label">广告位类型</label>

							<div class="col-sm-8">
								<select name="type" id="type" class="form-control">
									<option value="1">单图</option>
									<option value="2">多图</option>
									<option value="3">文字</option>
								</select>
							</div>
						</div>
						

						
						

						<div class="form-group">
							<label for="width" class="col-sm-2 control-label">宽</label>

							<div class="col-sm-8">
								<input type="text" id="width" class="form-control" name="width" data-parsley-required="false" placeholder="宽">
							</div>
						</div>
						<div class="form-group">
							<label for="height" class="col-sm-2 control-label">宽</label>

							<div class="col-sm-8">
								<input type="text" id="height" class="form-control" name="height" data-parsley-required="false" placeholder="高">
							</div>
						</div>
						
						
						
						

					</div>
				</div>
				<div class="col-lg-3"></div>
				<div class="col-lg-6">
					<div class="form-group text-center">
						<label></label>

						<div>
							<button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
						</div>
					</div>
				</div>
			</form>
		</section>

	</div>
</div>

<script language="JavaScript">
	$(document).ready(function() {
	
		$('#addForm').ajaxForm({
			dataType: 'json',
			beforeSubmit: function(arr, form, options) {
				
				form.find("button:submit").button("loading");
				
			},
			success: function(data, statusText, xhr, form) {
				if(data.errno == 0) {
					Toast.success(data.data);
					//刷新父级菜单
					//form.resetForm();
				}
				else {
					Toast.error(data.errmsg);
				}
				form.find("button:submit").button("reset");
			}
		});

	});

	
</script>
{% endblock %}